package com.foreknow.demo3;

import java.lang.reflect.Array;
import java.util.Arrays;

public class Test5 {
    public static void main(String[] args) {
        int[] arr = {12,34,56,11,7,9,34};
        Arrays.sort(arr);//冒泡排序
        for (int i = 0;i < arr.length;i++){
            System.out.println(arr[i]);
        }
        //数组的遍历(简便)
        for (int item:arr)
        {
            System.out.println(item);
        }
        //二分查找
        int index = Arrays.binarySearch(arr,11);
        System.out.println(index);
    }
}
